import React, { Component } from 'react';
import {
    StyleSheet,
    ScrollView,
    View,
    StatusBar,
    TouchableOpacity
} from 'react-native';
import { observer } from 'mobx-react/native';
import DefaultInfo from '../data/defaultInfo';
import Article from './article';
@observer
export default class ArticleList extends Component {
    static navigationOptions = {
        title: '文章列表',
        header: {
            visible: false,
        },
    };
    render() {
        const { navigate } = this.props.navigation;
        const list =  DefaultInfo.articles.map((article) => {
            return <Article article={article} navigate={ navigate } key={article._id} />
        });
        return (
            <View>
                <StatusBar
                    backgroundColor="#97cc00"
                    barStyle="light-content"
                />
                <ScrollView>{list}</ScrollView>
            </View>
        );
    }
}